<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="x-ua-compatible" content="ie=edge">
	<title>我的地址</title>
	<link rel="stylesheet" href="<?php echo IMG_PATH ?>bdkd/css/reset.css">
	<link rel="stylesheet" href="<?php echo IMG_PATH ?>bdkd/css/newDizhi.css">
    <!-- <meta name="description" content=""> -->
   <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
   <!-- <link href="apple-touch-icon.png" rel="apple-touch-icon"> -->
	
	<!-- <script src="http://g.tbcdn.cn/mtb/lib-flexible/0.3.4/??flexible_css.js,flexible.js"></script> -->
	<script src="<?php echo IMG_PATH ?>bdkd/js/newDizhi_flexible.js"></script>
	 <!-- <link href="apple-touch-icon.png" rel="apple-touch-icon"> -->
	 <link href="https://cdn.bootcss.com/framework7/1.6.5/css/framework7.ios.min.css" rel="stylesheet">
    <!-- <link href="https://cdn.bootcss.com/framework7/1.6.5/css/framework7.ios.colors.min.css" rel="stylesheet"> -->
    <link href="<?php echo IMG_PATH ?>bdkd/css/newDizhi_style.css" rel="stylesheet">
	
</head>
<body >

	<header>
		<ul>
		
			<li>
				<!-- <input type="text" name="" placeholder="取件人姓名" value="" class="ipt1"> -->
			</li>
			<li>
				<!-- <input class="shouji ipt2" type="text" placeholder="手机号码" name="" value="" style="border-bottom:none;">	 -->
			</li>
			<li class="phone" style="padding:0;border-top:none;">
				<div class="views">
			        <div class="view view-main">
			            <div class="pages">
			                <div class="page" data-page="home">
			                    <div class="hide-tabbar-on-scroll">
			                        <div class="list-block">
			                            <ul>
			                                <li>
			                                    <div class="item-content">
			                                        <div class="item-inner" style="width:100%">
			                                            <div class="item-input">
			                                                <input style="width:320px;" type="text" value="河北省廊坊市三河市燕郊镇" disabled="disabled" id="location" name="location" class="ipt4">
			                                            </div>
			                                        </div>
			                                    </div>
			                                </li>
			                            </ul>
			                        </div>
			                    </div>
			                </div>
			            </div>
			        </div>
			    </div>
			    <script src="<?php echo IMG_PATH ?>bdkd/js/jquery.min.js"></script>
			    <script src="<?php echo IMG_PATH ?>bdkd/js/newDizhi_framework7.min.js"></script>
			    <script src="<?php echo IMG_PATH ?>bdkd/js/newDizhi_regionsObject2.js"></script>
			    <script src="<?php echo IMG_PATH ?>bdkd/js/newDizhi_cityPicker.js"></script>
			</li>
			<li>
				<textarea id="address" class="wenbenyu ipt3" placeholder="详细地址(如楼号/单元/门牌号)"


                          ><?php
                    if(!empty($area->addres)){
                        $str=$area->addres;
                        $strDelimiter="燕郊镇";
                        $arr=preg_split('/'.preg_quote($strDelimiter,'/').'/',$str);
                        echo $arr[1];
                    }

                    ?></textarea>
			
			</li>
		</ul>
	</header>


	<section>
	<!-- onclick="window.open('../jikkuaidi/ji.html?path=4')" -->
		<a onclick=""><div class="btn" onclick="add()">确定</div></a>
		<!-- <a onclick="window.open('../wuliutuoyun/wu.html')"><div class="btn1" onclick="wuliuadd()">确定</div></a>
		<a onclick="window.open('../qukuaidi/qukuaidi.html')"><div class="btn2" onclick="qukuaidiadd()">确定</div></a> -->
		<!-- onclick="window.open('../wuliutuoyun/wu.html')" -->
	</section>

	<script src="<?php echo IMG_PATH ?>bdkd/js/jquery-1.11.1.min.js"></script>
	<script src="<?php echo IMG_PATH ?>bdkd/js/newDizhi.js"></script>

	<script>
		function add(){
			var oIpt3 = document.querySelector(".ipt3");
			var location=$.trim($("#location").val());
			var address = $('#address').val();

//			if(address==0){
//				alert('请填写详细地址');
//				return false;
//			}

			$.ajax({
				url:"<?php echo SITE_PATH ?>work/buser/addarea",
				type:"post",
				data:{
				    'location':location,
                    'type':0,
					'address': address
				},
				success: function(data){
					console.log(data);
					if(data.result==1){
						alert('提交成功!');
						var g=localStorage;
						g.setItem('fxinxi',oIpt3.value);
						window.location.href = '<?php echo SITE_PATH ?>work/buser/personal';
					}else {
						alert(data.msg);
					}
				},
				error: function(){
					alert('提交失败0!');
				}
//                async:"false";
			})
		}
	</script>

	<!-- window.open('../jikkuaidi/ji.html') -->
</body>
</html>